<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="format-detection" content="telephone=yes" />
    <meta content="noindex,nofollow" name="robots" />
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
    <meta http-equiv="expires" content="0">
    <title>久久商城</title>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/themes/css/core.css?v={$v}">
    <link rel="stylesheet" type="text/css" href="__STATIC__/themes/css/icon.css?v={$v}">
    <link rel="stylesheet" type="text/css" href="__STATIC__/themes/css/home.css?v={$v}">
    <script type="text/javascript" src="__STATIC__/themes/js/jquery.min.js?v={$v}"></script>
</head>
<body>

<header class="aui-header-default aui-header-fixed aui-header-bg">
    <div class="aui-header-center aui-header-center-clear">
        <div class="aui-header-center-logo">
            <div class="aui-car-white-Typeface">确认订单</div>
        </div>
    </div>
</header>
<section class="aui-address-content">
    <form action="{:url('index/shop/saveOrder')}" method="post" id="buForm">
        <input type="hidden" name="productId" value="{$id}">
        <input type="hidden" name="shopId" value="{$sid}">
        <input type="hidden" name="addressId" value="{$address.id}" id="hAdd">
        <input type="hidden" name="gid" value="{$gid}">
        <div class="aui-address-box">
            <div class="aui-address-box-list">
                <a href="{:url('index/shop/userAddress',['id'=>$id,'sid'=>$sid,'gid'=>$gid])}" class="aui-address-box-default">
                    <ul>
                        <li>
                            <strong>{$address.name} {$address.phone}</strong>
                        </li>
                        <li>
                            <i class="aui-icon aui-icon-address"></i>
                            {$address.country}{$address.city}{$address.district}{$address.address}
                        </li>
                    </ul>
                </a>
            </div>
        </div>
        <div style="padding:15px;">
            <div>备注信息：</div>
            <div style="margin-top:10px">
                <input type="text" id="info" name="note" style="border: 1px solid #ccc;padding:1%;width:98%;" />
            </div>
        </div>
        <div class="aui-dri"></div>
        <div class="aui-list-product-float-item">
            <a href="javascript:;" class="aui-list-product-fl-item">
                <div class="aui-list-product-fl-img">
                    <img src=" {$product.img}" alt="">
                </div>
                <div class="aui-list-product-fl-text">
                    <h3 class="aui-list-product-fl-title">
                       {$product.title}
                    </h3>
                    <div class="aui-list-product-fl-mes">
                        <div><span class="aui-list-product-item-price"><em>¥</em>{$price}</span></div>
                        <div>
                            <button type="button" class="btn btn-warning" onclick="reduceNum('{$price}')">-</button>
                            <input type="text" name="num" value="1" id="pNum" style="margin-left: 10px;margin-right: 10px;width: 30px;height: 30px;text-align: center">
                            <button type="button" class="btn btn-warning" onclick="addNum('{$price}')">+</button>
                        </div>
                    </div>
                </div>
            </a>
        </div>

        <div class="aui-payment-bar">
            <div class="shop-total">
                <span class="aui-red aui-size">实付款: <em id="AllTotal2">￥{$price}</em></span>
            </div>
            <input type="submit" value="提交并支付" class="settlement" style="font-size:14px;width:120px;border: none">
        </div>
    </form>
</section>

<script>
    function reduceNum(price) {
        var pNum =parseInt($("#pNum").val())-1 ;
        if(pNum<=1){
            $("#pNum").val(1)
            $("#AllTotal2").text("￥"+price);
        }
        else{
            $("#pNum").val(pNum);
            price = price * pNum;
            $("#AllTotal2").text("￥"+price);
        }
    }

    function addNum(price) {
        var pNum =parseInt($("#pNum").val())+1 ;
        if(pNum<=1){
            $("#pNum").val(1)
            $("#AllTotal2").text("￥"+price);
        }
        else{
            $("#pNum").val(pNum);
            price = price * pNum;
            $("#AllTotal2").text("￥"+price);
        }
    }

    $("#buForm").submit(function () {
        var hAdd = $("#hAdd").val();
        if(!hAdd){
            alert('请选择收货地址');
            return false;
        }
        else{
            return  true;
        }
        return false;
    });


</script>

<script type="text/javascript" src="__STATIC__/themes/js/aui.js?v={$v}"></script>
<script src="__STATIC__/js/h5/add_upgrade_order.js?v={$v}"></script>
<script src="__STATIC__/js/h5/j.js"></script>
<script src="__STATIC__/layer/mobile/layer.js"></script>
</body>
</html>